1 <?php
2     include(
"../ckeditor/ckeditor.php");
3 ?>
4 <script type=
"text/javascript" src="../ckeditor/ckeditor.js"></script>
5 <script type=
"text/javascript" src="../ckeditor/ckfinder/ckfinder.js"></script>
6 <?
7 $path=
"../upload";
8 $pathdb=
"upload";
9
10 if
(isset($_POST['butSaveLoai'])) {
11     $id=$_POST[
'ddContent'];
12     $desc=$_POST[
'txtDesc'];
13     $link=$_POST[
'txtDescen'];
14     $imageSmall=$_FILES[
'txtImage'];
15             
16     $err=
"";
17     $err.=CheckUpload($_FILES[
"txtImage"],".jpg;.gif;.swf;.bmp;.avi;.wma;.dat;.mp3;.wmv",3000*1024,0);
18         
19     
if ($err=="")
20     {
21         
if (mysql_query("update info set content='".$desc."',link='".$link."' where id='".$id."'",$con)) {
22             
if ($_POST['chkClear']=='')
23             {
24                 $sqlUpdateField =
"";
25                 $extsmall=GetFileExtention($_FILES[
'txtImage']['name']);
26                     
if (MakeUpload($_FILES['txtImage'],"$path/content_s$id$extsmall"))
27                     {
28                         @chmod(
"$path/content_s$id$extsmall", 0777);
29                         $sqlUpdateField =
" image='$pathdb/content_s$id$extsmall' ";
30                     }
31
32             }
33             
else
34                 {
35                 $pro=GetContentInfo($id);
36                 
if (file_exists("../".$pro['image'])) unlink("../".$pro['image']);
37                 $sqlUpdateField =
" image='' ";
38                 }
39             
if($sqlUpdateField)
40             {
41                 $sqlUpdate =
"update info set $sqlUpdateField where id='".$id."'";
42                 mysql_query($sqlUpdate,$con);
43             }
44         }
45         
else {
46             $err =
"<p align=center class='err'>Không th&#7875; c&#7853;p nh&#7853;t</p>";
47         }
48         
if ($err=='') echo "<p align=center class='err'>&#272;ã c&#7853;p nh&#7853;t thành công</p>";
49         
//if ($err=='') echo '<script>window.location="index.php?act=content&id='.$_REQUEST['id'].'&code=1"</script>';
50      }
51     
if ($err!="") echo "<p align=center class='err'>".$err."</p>";
52 }
53 $id=
1;
54 if
($_REQUEST['id']!='') $id=$_REQUEST['id'];
55 $cont=GetContentInfo($id);
56 $desc=$cont[
'content'];
57 $link=$cont[
'link'];
58 ?>
59
60
61 <form method=
"post" name="FormLoaiSP" enctype="multipart/form-data" action="index.php?">
62 <input type=
"hidden" name="act" value="content">
63 <input type=
"hidden" name="id" value="<? echo $_REQUEST['id']; ?>">
64 <table border=
"1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#0069A8" width="100%" id="AutoNumber1">
65   <tr>
66     <td width=
"45%" class="title" align="center">C&#7853;p nh&#7853;t: N&#7897;i dung</td>
67   </tr>
68   <tr>
69     <td width=
"45%">
70     <table border=
"0" cellpadding="2" bordercolor="#111111" width="100%" id="AutoNumber2" cellspacing="0">
71 <tr>
72         <td width=
"99%" class="smallfont" colspan="4" align="center">
73 <?
if ($cont['image']!='') { ?>
74         <img border=
"0" src="../<? echo $cont['image']; ?>">
75 <? } ?>
76         </td>
77       </tr>
78             <tr>
79         <td width=
"15%" class="smallfont">
80         <p align=
"right">Ch&#7885;n n&#7897;i dung</td>
81         <td width=
"1%" class="smallfont" align="center">
82         <font color=
"#FF0000">*</font></td>
83         <td width=
"4%" class="smallfont">
84         <
select size="1" name="ddContent">
85 <?
86 $list=GetListContent();
87 $id=$_REQUEST[
'id'];
88 foreach
($list as $c)
89 {
90     
if ($id=="") $id=$c[0];
91     
if ($c[0]!==$_REQUEST['id'])
92         echo
'<option value="'.$c[0].'">'.$c[1].'</option>';
93     
else
94         echo
'<option selected value="'.$c[0].'">'.$c[1].'</option>';
95 }
96 ?>
97         </
select></td>
98         <td width=
"79%" class="smallfont">
99         <input type=
"button" value="Chuy&#7875;n" name="B1" class="button" onclick="javascript:window.location='./?act=content&id='+ddContent.value"></td>
100       </tr>
101        <tr>
102         <td width=
"15%" class="smallfont" align="right">
103         Hình &#
7843;nh</td>
104         <td width=
"1%" class="smallfont" align="center">
105         &nbsp;</td>
106         <td width=
"83%" class="smallfont" colspan="2">
107         <INPUT TYPE=
"file" NAME="txtImage" CLASS=textbox size="34"><input type="checkbox" name="chkClear" value="ON">Xóa
108         b&#
7887; hình</td>
109       </tr>
110
111 <?
if($_REQUEST['id']==8){?>
112       <tr>
113         <td width=
"15%" class="smallfont" align="right">
114         Ng&#
432;&#7901;i nh&#7853;n</td>
115         <td width=
"1%" class="smallfont" align="center">&nbsp;
116         </td>
117         <td width=
"83%" class="smallfont" colspan="2">
118         <textarea rows=
"2" name="txtDescen" cols="60"><? echo $link; ?></textarea>
119 </td></tr>
120 <?}
else {?>
121       <tr>
122         <td width=
"15%" class="smallfont" align="right">
123         Link</td>
124         <td width=
"1%" class="smallfont" align="center">
125         &nbsp;</td>
126         <td width=
"83%" class="smallfont" colspan="2">
127        
128             <input type=
"text" name="txtDescen" value="<? echo $link; ?>" style="width:500px">
129
130         </td>
131       </tr>
132       <?}?>
133
134
135 <?
if($_REQUEST['id']==8){?>
136       <tr>
137         <td width=
"15%" class="smallfont" align="right">
138         Ng&#
432;&#7901;i nh&#7853;n</td>
139         <td width=
"1%" class="smallfont" align="center">&nbsp;
140         </td>
141         <td width=
"83%" class="smallfont" colspan="2">
142         <textarea rows=
"2" name="txtDesc" cols="60"><? echo $desc; ?></textarea>
143 </td></tr>
144 <?}
else {?>
145       <tr>
146         <td width=
"15%" class="smallfont" align="right">
147         N&#
7897;i dung</td>
148         <td width=
"1%" class="smallfont" align="center">
149         &nbsp;</td>
150         <td width=
"83%" class="smallfont" colspan="2">
151  <p>
152     <textarea name=
"txtDesc" cols="60" rows="20"><? echo $desc; ?></textarea>
153 </p>
154 <?php
155 $CKEditor =
new CKEditor();
156 $CKEditor->basePath =
'../ckeditor/';
157 $CKEditor->replace(
"txtDesc");
158 ?>
159         </td>
160       </tr>
161       <?}?>
162
163
164
165
166
167
168
169       <tr>
170         <td width=
"15%" class="smallfont" colspan="2">
171         <p align=
"right">
172         <INPUT TYPE=
"submit" NAME="butSaveLoai" VALUE="C&#7853;p nh&#7853;t" CLASS=button onclick="submitForm()">&nbsp;</td>
173         <td width=
"84%" class="smallfont" align="center" colspan="2">
174         <p align=
"left">&nbsp;<INPUT TYPE="reset" CLASS=button value="Nh&#7853;p l&#7841;i"></td>
175       </tr>
176     </table>
177     </td>
178   </tr>
179   </table>
180 </form>



Full source code website bán hàng thương mại điện tử gần giống shopee 468.961 lượt xem

Gõ tìm kiếm nhanh...